package com.chuangjiangx.member.stored.ddd.dal.condition;

import com.chuangjiangx.commons.QueryCondition;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * 储值明细列表接口参数--商户平台
 * Created by YangKuo on 2017/11/28.
 */
@Getter
@Setter
public class QueryMerchantStoredListCondition extends QueryCondition {

    private Long merchantId;

    private Long memberId;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 结束时间
     */
    private Date endTime;

    /**
     * 储值类型：1：消费，2：兑换，3：退款, 4：储值赠送
     */
    private Byte type;

    /**
     * 交易单号
     */
    private String storedNum;

    /**
     * 门店名称
     */
    private String storeName;

    public void setStoredNum(String storedNum) {
        if (StringUtils.isNotBlank(storedNum)) {
            this.storedNum = "%" + storedNum + "%";
        }
    }

    public void setStoreName(String storeName) {
        if (StringUtils.isNotBlank(storeName)) {
            this.storeName = "%" + storeName + "%";
        }
    }
}
